﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="FlaggedCommentsContext.aspx.cs" Inherits="AdminPages_FlaggedCommentsContext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h5>Comments</h5>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="CommentID" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="CommentID" HeaderText="CommentID" 
                InsertVisible="False" ReadOnly="True" SortExpression="CommentID" />
            <asp:BoundField DataField="Comment" HeaderText="Comment" 
                SortExpression="Comment" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT [CommentID], [Comment] FROM [Comment] WHERE ([MovieID] = @MovieID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="MovieID" QueryStringField="MovieID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <h5>Flagged Comment</h5>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="CommentID" 
        DataSourceID="SqlDataSource2">
        <EditItemTemplate>
            Comment:
            <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
            <br />
            CommentID:
            <asp:Label ID="CommentIDLabel1" runat="server" 
                Text='<%# Eval("CommentID") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Aktualisieren" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Abbrechen" />
        </EditItemTemplate>
        <InsertItemTemplate>
            Comment:
            <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Einfügen" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Abbrechen" />
        </InsertItemTemplate>
        <ItemTemplate>
            Comment:
            <asp:Label ID="CommentLabel" runat="server" Text='<%# Bind("Comment") %>' />
            <br />
            CommentID:
            <asp:Label ID="CommentIDLabel" runat="server" Text='<%# Eval("CommentID") %>' />
            <br />
        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        
        SelectCommand="SELECT CommentID, Comment  FROM Comment WHERE (CommentID = @FlaggedCommentID)">
        <SelectParameters>
            <asp:QueryStringParameter Name="FlaggedCommentID" 
                QueryStringField="FlaggedID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

